import sys
sys.path.append("..")

from tfidfarff import getidfvalues,gettfidfvalues
import unittest

class TestIDF(unittest.TestCase):
    """
    """
    veclist = [
        [1,0,0,0],
        [1,1,0,0],
        [1,0,1,0],
        [1,1,1,1],
        ]
    idflist = [0,1,1,2]
    tfidflist = [
        [0,0,0,0],
        [0,0.5,0,0],
        [0,0,0.5,0],
        [0,0.25,0.25,0.5],
        ]
    
    def testidf(self):
        """
        """
        self.assertEqual(getidfvalues(self.veclist),self.idflist)
        
    def testtfidf(self):
        """
        """
        self.assertEqual(gettfidfvalues(self.veclist),self.tfidflist)

if __name__ =="__main__":
    unittest.main()
